for (const item of args.form) {
	const trans = lib.newTransaction();
	try {
		let id = item.id;
		let all_product_good_num = item.allProductGoodNum;
		let all_product_bad_num = item.allProductBadNum;
		let product_receive_num = item.productReceiveNum;
		let delivery_order_sn = item.deliveryOrderSn;
		let product_name = item.productName;
		let warehouse = item.warehouse;
		let whb_code_good_id = item.whbCodeGoodId;
		lib.dbUpdate('UPDATE quality_check_storage SET product_good_num = IF(all_product_good_num IS NULL,0,all_product_good_num),product_bad_num = IF(all_product_bad_num IS NULL,0,all_product_bad_num),qc_status = 2 WHERE id = ? AND del_flag = 0',id);
		lib.dbUpdate('UPDATE receipt_product SET product_good_num = (IF(product_good_num IS NULL,0,product_good_num) + ?),product_bad_num =(IF(product_bad_num IS NULL,0,product_bad_num) + ?),tested_quantity = (? + ?),qc_status = 1,no_qc_num = no_qc_num-reflecti,reflecti = reflecti-?,qs_message = (SELECT qc_sn FROM quality_check_storage WHERE id = ? AND del_flag = 0) WHERE id = ( SELECT receipt_product_id FROM quality_check_storage WHERE id = ? AND del_flag = 0 ) AND del_flag = 0',all_product_good_num,all_product_bad_num,all_product_good_num,all_product_bad_num,product_receive_num,id,id);
		lib.dbUpdate('UPDATE stock_in_product a SET a.good_product =(IF( a.good_product IS NULL, 0, a.good_product ) + ?),a.defective_product =(IF( a.defective_product IS NULL, 0, a.defective_product ) + ?),wait_quantity = wait_quantity-?,a.wait_putaway = IF((SELECT type FROM warehouse_bin where id = ?)=5,0,(IF( a.wait_putaway IS NULL, 0, a.wait_putaway ) + ?)) WHERE a.parent_stock_in_id = ( SELECT id FROM stock_in si WHERE si.associated_po =? AND si.warehouse =? AND si.del_flag = 0 ) AND a.product_id =? AND del_flag  =0',all_product_good_num,all_product_bad_num,product_receive_num,whb_code_good_id,all_product_good_num,delivery_order_sn,warehouse,product_name);
		trans.commit();
	} catch (e) {
		lib.addUserMessage("审批出现异常，异常之间单号："+item.qcSn);
		trans.rollback();
	}
}
'执行成功！'